#ifndef _SOUND_H

#include "types.h"
#include "sound_config.h"
#include "proc.h"

#define RECV_NODE_SIZE 256

typedef struct sc_node{
	int used, write_offset, read_offset;
    int recv_head;
    struct proc* p;
} sc_node;
typedef struct recv_node {
    uint32 offset, length; uint8 mbuf[MBUF_SIZE];
    int next;
} recv_node;

void sound_init();
short sound_open();
ssize_t sound_read(short,void *,size_t);
ssize_t sound_write(short,const void *,size_t);
void sound_close(short);
ssize_t sound_transmit(short, const void *, uint32, uint32);
void sound_recv();

#endif
